
package com.wutianyi.arithmetic;

import java.net.URLDecoder;
import java.net.URLEncoder;

import org.apache.commons.lang.StringUtils;


/**
 * Hello world!
 * 
 */
public class App {

	/**
	 * 需要跨域的url
	 */
	private static final String	crossDomain			= "http://ku.duowan.com";
	/**
	 * 实现跨域的跳板机
	 */
	private static final String	crossDomainProxy	= "http://ka.duowan.com/clientLogin.php?";

	public static void main(String[] args) {
		String url = "http://ku.duowan.com/tianyijue/?yxtq_ka_content";
		DesEncrypt encrypt = new DesEncrypt();
		encrypt.getKey("ka.duowan.com");
		if(url.startsWith(crossDomain)) {
			url = crossDomainProxy + "key=" + encrypt.getEncString("wutianyi") + "&redirect=" + URLEncoder.encode(url + "?yxtq_tq_video");
		}
		System.out.println(url);
		
		System.out.println(URLDecoder.decode("http%3A%2F%2Fku.duowan.com%2Flangman%2F%3Fyxtq_ka_content?yxtq_ka_content"));

	}
}
